<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<style type="text/css">

body{
	padding:20px;
}
.even{
	background:#eee;
}
.odd{
	background:#f2f399;
}
</style>

</head>
<body>

    <div class="desk">
      <div class="app-create fl">
        <div class="app-create-hline"></div>
        <div class="app-create-vline"></div>
        <div class="app-create-text">新增基础服务</div>
      </div>    
      <div class="app-myapp fl ${bgcolor}">
        <div class="app-myapp-shared">{{tip}}</div>
        <div class="app-myapp-photo icons"></div>
        <div class="app-myapp-caption">{{title}}</div>
        <div class="app-myapp-op">
          <div class="fl begin_cur"> <span></span> </div>
          <div class="fl stop_cur"> <span></span> </div>
          <div class="fr close_cur"> <span></span> </div>
          <div class="fr set"> <span></span> </div>
        </div>
      </div>
    </div>

</body>
</html>

<script src="script/libs/jquery/jquery.js"></script>
<script src="script/libs/ui/template.js"></script>
<script>

var item;
var data = [
    {
        title:"xxx",
        obj:{
            title:"yyy",
            _title:"4y"
        }
    },
    {
        title:"xxx",
        obj:{
            title:"yyy",
            _title:"yyyy"
        }
    }
];


var i,v;
var temp,temp2;
for(i=0;i<data.length;i++)
{
    item = data[i];
    for(v in item)
    {
        if(typeof(item[v])!="object")
        {
            Object.defineProperty(item , v, {
              get: function() {
                return temp;
                },
              set: function(o) {
                temp = o;
                }
            });              
        }
        else
        {
            Object.defineProperty(item[v] , "title", {
              get: function() {
                return this["_title"];
                },
              set: function(o) {
                temp2 = o;
                }
            });
        }
    }
    
}

data[0].title = "xxx";
data[0].title = "nnn";
console.log(data[0]);

console.log(data[0].title);
console.log(data[0].obj.title);
console.log(data[0]);
</script>

